package classloading;

import java.util.logging.Level;
import java.util.logging.Logger;

public class ClassLoaderTest {

	/**
	 * @param args
	 */
	public static void main(String args[]) {
		try {
			// printing ClassLoader of this class
			System.out.println("ClassLoaderTest.getClass().getClassLoader() : "
					+ ClassLoaderTest.class.getClassLoader());
			System.out.println("Paren1##"+ClassLoaderTest.class.getClassLoader().getParent());
			System.out.println("Paren2##"+ClassLoaderTest.class.getClassLoader().getParent().getParent());
			// trying to explicitly load this class again using Extension class
			// loader
			Class.forName("test.ClassLoaderTest", true, ClassLoaderTest.class.getClassLoader().getParent());
		} catch (ClassNotFoundException ex) {
		//	Logger.getLogger(ClassLoaderTest.class.getName()).log(Level.SEVERE, null, ex);
		}
	}

}
